Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(tpu-v2): provide ethcoin support in tpu kickstart process #2300

Open
wants to merge 10 commits into
base: fix-tpu-v2-wait-for-payment-spend
Choose a base branch
from

Conversation

laruh
Copy link
Member

@laruh laruh commented Dec 22, 2024

This pr provides EthCoin support in kickstart handler for taker and maker swaps

added test_v2_eth_eth_kickstart

@laruh laruh force-pushed the fix-tpu-v2-wait-for-payment-spend-kickstart branch from d08fa86 to df7778c Compare December 22, 2024 11:36
@mariocynicys mariocynicys self-assigned this Dec 23, 2024
@mariocynicys mariocynicys self-requested a review December 23, 2024 13:00
@mariocynicys mariocynicys removed their assignment Dec 23, 2024
Copy link
Member

@borngraced borngraced left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

welldone, 3 minor notes

mm2src/mm2_main/src/lp_swap/swap_v2_common.rs Outdated Show resolved Hide resolved
mm2src/mm2_main/src/lp_swap/swap_v2_common.rs Outdated Show resolved Hide resolved
mm2src/mm2_main/src/lp_swap/swap_v2_common.rs Outdated Show resolved Hide resolved
Copy link
Collaborator

@mariocynicys mariocynicys left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks
LGTM

mm2src/mm2_main/src/lp_swap/swap_v2_common.rs Outdated Show resolved Hide resolved
Copy link
Member

@onur-ozkan onur-ozkan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please ping me once you are done with reviews @borngraced

Copy link
Member

@borngraced borngraced left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

great work!

@onur-ozkan
Copy link
Member

Can you add test coverage for ETH ? Seems like we have one for UTXOs

#[test]
fn test_v2_swap_utxo_utxo_kickstart() {

@laruh
Copy link
Member Author

laruh commented Dec 24, 2024

Can you add test coverage for ETH ? Seems like we have one for UTXOs

#[test]
fn test_v2_swap_utxo_utxo_kickstart() {

I can, but it will be on sepolia and use feature flag

@onur-ozkan
Copy link
Member

I can, but it will be on sepolia and use feature flag

No problem I guess, better than nothing

@laruh laruh force-pushed the fix-tpu-v2-wait-for-payment-spend-kickstart branch from 6c332f2 to 1e10d83 Compare December 26, 2024 14:05
@laruh laruh force-pushed the fix-tpu-v2-wait-for-payment-spend-kickstart branch from 1e10d83 to d48cc25 Compare December 26, 2024 14:09
@laruh laruh requested a review from mariocynicys December 27, 2024 08:33
…d' into fix-tpu-v2-wait-for-payment-spend-kickstart
@laruh
Copy link
Member Author

laruh commented Dec 27, 2024

Added test_v2_eth_eth_kickstart test.
It uses Geth node, checks that taker and maker restarted their tpu eth-eth swap after stop (active swap uuid should be the same as before stop).

Copy link
Member

@borngraced borngraced left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

re-approve

Comment on lines +2812 to +2819
let uuids = block_on(start_swaps(&mut mm_bob, &mut mm_alice, &[(ETH, ETH1)], 1.0, 1.0, 77.));
log!("{:?}", uuids);
let parsed_uuids: Vec<Uuid> = uuids.iter().map(|u| u.parse().unwrap()).collect();

for uuid in uuids.iter() {
log_swap_status_before_stop(&mm_bob, uuid, "Maker");
log_swap_status_before_stop(&mm_alice, uuid, "Taker");
}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: uuids is just a single item in a vector. you might want to extract it.

Comment on lines +2824 to +2826
// Restart Bob and Alice
bob_conf.conf["dbdir"] = mm_bob.folder.join("DB").to_str().unwrap().into();
bob_conf.conf["log"] = mm_bob.folder.join("mm2_dup.log").to_str().unwrap().into();
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: or you might just use MarketMakerIt::seednode_trade_v2

Comment on lines +2832 to +2834
alice_conf.conf["dbdir"] = mm_alice.folder.join("DB").to_str().unwrap().into();
alice_conf.conf["log"] = mm_alice.folder.join("mm2_dup.log").to_str().unwrap().into();
alice_conf.conf["seednodes"] = vec![mm_bob.ip.to_string()].into();
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: or MarketMakerIt::light_node_trade_v2

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

btw, why create a different mm2_dup.log? u could not call mm_dump if u want.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants